package org.dromara.common.core.domain.model

import jakarta.validation.constraints.NotBlank

/**
 *@author LikeYouDo
 *@date 2025/1/3 16:48
 */
data class SmsLoginBody(
    /**
     * 手机号
     */
    @NotBlank(message = "{user.phonenumber.not.blank}")
    var phonenumber: String = "",

    /**
     * 短信code
     */
    @NotBlank(message = "{sms.code.not.blank}")
    var smsCode: String = "",
) : LoginBody() {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is SmsLoginBody) return false
        if (!super.equals(other)) return false

        if (phonenumber != other.phonenumber) return false
        if (smsCode != other.smsCode) return false

        return true
    }

    override fun hashCode(): Int {
        var result = super.hashCode()
        result = 31 * result + phonenumber.hashCode()
        result = 31 * result + smsCode.hashCode()
        return result
    }
}
